# Tagfolder
#http://code.google.com/p/tagfolder/
#Licensed under LGPL
#
#

PROJECT(COMMON)

INCLUDE_DIRECTORIES(BEFORE 	
    "${tagfolder_base_dir}/depends/include/"
    "${tagfolder_base_dir}/depends/sqlite3"
    "${tagfolder_base_dir}/src/common/include/"
    "${CMAKE_CURRENT_SOURCE_DIR}")

LINK_DIRECTORIES(
    "${tagfolder_base_dir}/depends/lib/${gtest_lib_dir}/"
    )
MESSAGE("${tagfolder_base_dir}/depends/lib/${gtest_lib_dir}")

#
#Build client stub
#
SET(LIB_TAGFOLDER_SRC 
    TFConfigurator.cpp
    TFChannel.cpp 
    TFNamedPipe.cpp 
    StringHasher.cpp
    TFDataRepo.cpp
    TFModules.cpp
    "${tagfolder_base_dir}/depends/sqlite3/sqlite3.c")

ADD_LIBRARY(tagfolder_dynamic SHARED 
    ${LIB_TAGFOLDER_SRC})


SET_TARGET_PROPERTIES(tagfolder_dynamic
    PROPERTIES
    OUTPUT_NAME "tagfolder" 
    CLEAN_DIRECT_OUTPUT 1)

ADD_LIBRARY(tagfolder_static STATIC 
    ${LIB_TAGFOLDER_SRC})

SET_TARGET_PROPERTIES(tagfolder_static
    PROPERTIES
    OUTPUT_NAME "tagfolder" 
    CLEAN_DIRECT_OUTPUT 1)
IF( CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
    TARGET_LINK_LIBRARIES( tagfolder_dynamic
        pthread dl)
    TARGET_LINK_LIBRARIES( tagfolder_static
        pthread dl)
ENDIF( CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)



#
#Build test case
#
#ADD_EXECUTABLE(TFConfiguratorTest 
#TFConfiguratorTest.cpp 
#TFConfigurator.cpp
#"${tagfolder_base_dir}/depends/sqlite3/sqlite3.c")

#SET_TARGET_PROPERTIES(TFConfiguratorTest
#PROPERTIES
#LINK_FLAGS "/NODEFAULTLIB:LIBC.lib")

#TARGET_LINK_LIBRARIES(TFConfiguratorTest 
#gtest.lib
#gtest_main.lib)
